/**
 * 2017年12月4日
 */
package org.textplantform.client;

import java.io.File;
import java.io.IOException;
import java.net.URL;
import java.util.List;

import org.datavec.api.conf.Configuration;
import org.datavec.api.split.FileSplit;
import org.datavec.api.writable.Writable;

import cn.edu.bjtu.parser.SeqDocParser;

/**
 * 提交指定的文件到文模型进行分类,然后存储
 * 
 * 示例代码,此基础上修改
 * 
 * @author Alex
 *
 */
public class Submitter {
	
	
	
	public static void main(String[] args) throws IOException, InterruptedException {
		Configuration config = new Configuration();
		//E:\\workspaces\\git\\textplantform\\textplantform-web\\src\\main\\resources\\config.xml
		URL url = new URL("file:\\E:\\workspaces\\git\\textplantform\\textplantform-web\\src\\main\\resources\\config.xml");
		config.addResource(url);
		SeqDocParser ptd = new SeqDocParser();
		System.out.println(config.get("testkey"));
		ptd.initialize(new FileSplit(new File(args[1])));
		while(ptd.hasNext()){
			List<Writable> line = ptd.next();
			System.out.println(line.get(0));
			System.out.println(line.get(1));
		}
	}
}
